<?php
/* 
 *供应商_产品关联管理
 */
class Supplier_reaction_typeAction extends CommonAction {
    public function insert()
    {
        $_POST['supplier_id'] = $_GET['supplier_id'];
        $_POST['reaction_type_id'] = $_GET['reaction_type_id'];
        $map = array(
            'supplier_id' => $_GET['supplier_id'],
            'reaction_type_id' => $_GET['reaction_type_id'],
            );
        $jumpUrl = __APP__.'/Supplier/reaction_type/id/'.$_GET['supplier_id'];
        $rs = M('Supplier_product')->where($map)->findAll();
        if(!is_array($rs))
            parent::insert($jumpUrl);
        else
            $this->error("该供应商已经有此反应类型！");
    }
}
?>
